(0) Obligation:

Clauses:

merge(X, [], X).
merge([], X, X).
merge(.(A, X), .(B, Y), .(A, Z)) :- ','(le(A, B), merge(X, .(B, Y), Z)).
merge(.(A, X), .(B, Y), .(B, Z)) :- ','(gt(A, B), merge(.(A, X), Y, Z)).
gt(s(X), s(Y)) :- gt(X, Y).
gt(s(X), zero).
le(s(X), s(Y)) :- le(X, Y).
le(zero, s(Y)).
le(zero, zero).

Query: merge(g,g,a)

(1) PrologToDTProblemTransformerProof (SOUND transformation)

Built DT problem from termination graph DT10.

(2) Obligation:

Triples:

leB(s(X1), s(X2)) :- leB(X1, X2).
gtC(s(X1), s(X2)) :- gtC(X1, X2).
mergeA(.(s(X1), X2), .(s(X3), X4), .(s(X1), X5)) :- leB(X1, X3).
mergeA(.(s(X1), X2), .(s(X3), X4), .(s(X1), X5)) :- ','(lecB(X1, X3), mergeA(X2, .(s(X3), X4), X5)).
mergeA(.(zero, X1), .(s(X2), X3), .(zero, X4)) :- mergeA(X1, .(s(X2), X3), X4).
mergeA(.(zero, X1), .(zero, X2), .(zero, X3)) :- mergeA(X1, .(zero, X2), X3).
mergeA(.(X1, X2), .(X3, X4), .(X3, X5)) :- gtC(X1, X3).
mergeA(.(X1, X2), .(X3, X4), .(X3, X5)) :- ','(gtcC(X1, X3), mergeA(.(X1, X2), X4, X5)).
mergeA(.(s(X1), X2), .(s(X3), X4), .(s(X3), X5)) :- gtC(X1, X3).
mergeA(.(s(X1), X2), .(s(X3), X4), .(s(X3), X5)) :- ','(gtcC(X1, X3), mergeA(.(s(X1), X2), X4, X5)).
mergeA(.(s(X1), X2), .(zero, X3), .(zero, X4)) :- mergeA(.(s(X1), X2), X3, X4).

Clauses:

mergecA(X1, [], X1).
mergecA([], [], []).
mergecA([], X1, X1).
mergecA(.(s(X1), X2), .(s(X3), X4), .(s(X1), X5)) :- ','(lecB(X1, X3), mergecA(X2, .(s(X3), X4), X5)).
mergecA(.(zero, X1), .(s(X2), X3), .(zero, X4)) :- mergecA(X1, .(s(X2), X3), X4).
mergecA(.(zero, X1), .(zero, X2), .(zero, X3)) :- mergecA(X1, .(zero, X2), X3).
mergecA(.(X1, X2), .(X3, X4), .(X3, X5)) :- ','(gtcC(X1, X3), mergecA(.(X1, X2), X4, X5)).
mergecA(.(s(X1), X2), .(s(X3), X4), .(s(X3), X5)) :- ','(gtcC(X1, X3), mergecA(.(s(X1), X2), X4, X5)).
mergecA(.(s(X1), X2), .(zero, X3), .(zero, X4)) :- mergecA(.(s(X1), X2), X3, X4).
lecB(s(X1), s(X2)) :- lecB(X1, X2).
lecB(zero, s(X1)).
lecB(zero, zero).
gtcC(s(X1), s(X2)) :- gtcC(X1, X2).
gtcC(s(X1), zero).

Afs:

mergeA(x1, x2, x3)  =  mergeA(x1, x2)

(3) TriplesToPiDPProof (SOUND transformation)

We use the technique of [DT09]. With regard to the inferred argument filtering the predicates were used in the following modes:
mergeA_in: (b,b,f)
leB_in: (b,b)
lecB_in: (b,b)
gtC_in: (b,b)
gtcC_in: (b,b)
Transforming TRIPLES into the following Term Rewriting System:
Pi DP problem:
The TRS P consists of the following rules:

MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4), .(s(X1), X5)) → U3_GGA(X1, X2, X3, X4, X5, leB_in_gg(X1, X3))
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4), .(s(X1), X5)) → LEB_IN_GG(X1, X3)
LEB_IN_GG(s(X1), s(X2)) → U1_GG(X1, X2, leB_in_gg(X1, X2))
LEB_IN_GG(s(X1), s(X2)) → LEB_IN_GG(X1, X2)
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4), .(s(X1), X5)) → U4_GGA(X1, X2, X3, X4, X5, lecB_in_gg(X1, X3))
U4_GGA(X1, X2, X3, X4, X5, lecB_out_gg(X1, X3)) → U5_GGA(X1, X2, X3, X4, X5, mergeA_in_gga(X2, .(s(X3), X4), X5))
U4_GGA(X1, X2, X3, X4, X5, lecB_out_gg(X1, X3)) → MERGEA_IN_GGA(X2, .(s(X3), X4), X5)
MERGEA_IN_GGA(.(zero, X1), .(s(X2), X3), .(zero, X4)) → U6_GGA(X1, X2, X3, X4, mergeA_in_gga(X1, .(s(X2), X3), X4))
MERGEA_IN_GGA(.(zero, X1), .(s(X2), X3), .(zero, X4)) → MERGEA_IN_GGA(X1, .(s(X2), X3), X4)
MERGEA_IN_GGA(.(zero, X1), .(zero, X2), .(zero, X3)) → U7_GGA(X1, X2, X3, mergeA_in_gga(X1, .(zero, X2), X3))
MERGEA_IN_GGA(.(zero, X1), .(zero, X2), .(zero, X3)) → MERGEA_IN_GGA(X1, .(zero, X2), X3)
MERGEA_IN_GGA(.(X1, X2), .(X3, X4), .(X3, X5)) → U8_GGA(X1, X2, X3, X4, X5, gtC_in_gg(X1, X3))
MERGEA_IN_GGA(.(X1, X2), .(X3, X4), .(X3, X5)) → GTC_IN_GG(X1, X3)
GTC_IN_GG(s(X1), s(X2)) → U2_GG(X1, X2, gtC_in_gg(X1, X2))
GTC_IN_GG(s(X1), s(X2)) → GTC_IN_GG(X1, X2)
MERGEA_IN_GGA(.(X1, X2), .(X3, X4), .(X3, X5)) → U9_GGA(X1, X2, X3, X4, X5, gtcC_in_gg(X1, X3))
U9_GGA(X1, X2, X3, X4, X5, gtcC_out_gg(X1, X3)) → U10_GGA(X1, X2, X3, X4, X5, mergeA_in_gga(.(X1, X2), X4, X5))
U9_GGA(X1, X2, X3, X4, X5, gtcC_out_gg(X1, X3)) → MERGEA_IN_GGA(.(X1, X2), X4, X5)
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4), .(s(X3), X5)) → U11_GGA(X1, X2, X3, X4, X5, gtC_in_gg(X1, X3))
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4), .(s(X3), X5)) → GTC_IN_GG(X1, X3)
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4), .(s(X3), X5)) → U12_GGA(X1, X2, X3, X4, X5, gtcC_in_gg(X1, X3))
U12_GGA(X1, X2, X3, X4, X5, gtcC_out_gg(X1, X3)) → U13_GGA(X1, X2, X3, X4, X5, mergeA_in_gga(.(s(X1), X2), X4, X5))
U12_GGA(X1, X2, X3, X4, X5, gtcC_out_gg(X1, X3)) → MERGEA_IN_GGA(.(s(X1), X2), X4, X5)
MERGEA_IN_GGA(.(s(X1), X2), .(zero, X3), .(zero, X4)) → U14_GGA(X1, X2, X3, X4, mergeA_in_gga(.(s(X1), X2), X3, X4))
MERGEA_IN_GGA(.(s(X1), X2), .(zero, X3), .(zero, X4)) → MERGEA_IN_GGA(.(s(X1), X2), X3, X4)

The TRS R consists of the following rules:

lecB_in_gg(s(X1), s(X2)) → U25_gg(X1, X2, lecB_in_gg(X1, X2))
lecB_in_gg(zero, s(X1)) → lecB_out_gg(zero, s(X1))
lecB_in_gg(zero, zero) → lecB_out_gg(zero, zero)
U25_gg(X1, X2, lecB_out_gg(X1, X2)) → lecB_out_gg(s(X1), s(X2))
gtcC_in_gg(s(X1), s(X2)) → U26_gg(X1, X2, gtcC_in_gg(X1, X2))
gtcC_in_gg(s(X1), zero) → gtcC_out_gg(s(X1), zero)
U26_gg(X1, X2, gtcC_out_gg(X1, X2)) → gtcC_out_gg(s(X1), s(X2))

The argument filtering Pi contains the following mapping:
mergeA_in_gga(x1, x2, x3)  =  mergeA_in_gga(x1, x2)
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
leB_in_gg(x1, x2)  =  leB_in_gg(x1, x2)
lecB_in_gg(x1, x2)  =  lecB_in_gg(x1, x2)
U25_gg(x1, x2, x3)  =  U25_gg(x1, x2, x3)
zero  =  zero
lecB_out_gg(x1, x2)  =  lecB_out_gg(x1, x2)
gtC_in_gg(x1, x2)  =  gtC_in_gg(x1, x2)
gtcC_in_gg(x1, x2)  =  gtcC_in_gg(x1, x2)
U26_gg(x1, x2, x3)  =  U26_gg(x1, x2, x3)
gtcC_out_gg(x1, x2)  =  gtcC_out_gg(x1, x2)
MERGEA_IN_GGA(x1, x2, x3)  =  MERGEA_IN_GGA(x1, x2)
U3_GGA(x1, x2, x3, x4, x5, x6)  =  U3_GGA(x1, x2, x3, x4, x6)
LEB_IN_GG(x1, x2)  =  LEB_IN_GG(x1, x2)
U1_GG(x1, x2, x3)  =  U1_GG(x1, x2, x3)
U4_GGA(x1, x2, x3, x4, x5, x6)  =  U4_GGA(x1, x2, x3, x4, x6)
U5_GGA(x1, x2, x3, x4, x5, x6)  =  U5_GGA(x1, x2, x3, x4, x6)
U6_GGA(x1, x2, x3, x4, x5)  =  U6_GGA(x1, x2, x3, x5)
U7_GGA(x1, x2, x3, x4)  =  U7_GGA(x1, x2, x4)
U8_GGA(x1, x2, x3, x4, x5, x6)  =  U8_GGA(x1, x2, x3, x4, x6)
GTC_IN_GG(x1, x2)  =  GTC_IN_GG(x1, x2)
U2_GG(x1, x2, x3)  =  U2_GG(x1, x2, x3)
U9_GGA(x1, x2, x3, x4, x5, x6)  =  U9_GGA(x1, x2, x3, x4, x6)
U10_GGA(x1, x2, x3, x4, x5, x6)  =  U10_GGA(x1, x2, x3, x4, x6)
U11_GGA(x1, x2, x3, x4, x5, x6)  =  U11_GGA(x1, x2, x3, x4, x6)
U12_GGA(x1, x2, x3, x4, x5, x6)  =  U12_GGA(x1, x2, x3, x4, x6)
U13_GGA(x1, x2, x3, x4, x5, x6)  =  U13_GGA(x1, x2, x3, x4, x6)
U14_GGA(x1, x2, x3, x4, x5)  =  U14_GGA(x1, x2, x3, x5)

We have to consider all (P,R,Pi)-chains

Infinitary Constructor Rewriting Termination of PiDP implies Termination of TRIPLES

(4) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4), .(s(X1), X5)) → U3_GGA(X1, X2, X3, X4, X5, leB_in_gg(X1, X3))
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4), .(s(X1), X5)) → LEB_IN_GG(X1, X3)
LEB_IN_GG(s(X1), s(X2)) → U1_GG(X1, X2, leB_in_gg(X1, X2))
LEB_IN_GG(s(X1), s(X2)) → LEB_IN_GG(X1, X2)
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4), .(s(X1), X5)) → U4_GGA(X1, X2, X3, X4, X5, lecB_in_gg(X1, X3))
U4_GGA(X1, X2, X3, X4, X5, lecB_out_gg(X1, X3)) → U5_GGA(X1, X2, X3, X4, X5, mergeA_in_gga(X2, .(s(X3), X4), X5))
U4_GGA(X1, X2, X3, X4, X5, lecB_out_gg(X1, X3)) → MERGEA_IN_GGA(X2, .(s(X3), X4), X5)
MERGEA_IN_GGA(.(zero, X1), .(s(X2), X3), .(zero, X4)) → U6_GGA(X1, X2, X3, X4, mergeA_in_gga(X1, .(s(X2), X3), X4))
MERGEA_IN_GGA(.(zero, X1), .(s(X2), X3), .(zero, X4)) → MERGEA_IN_GGA(X1, .(s(X2), X3), X4)
MERGEA_IN_GGA(.(zero, X1), .(zero, X2), .(zero, X3)) → U7_GGA(X1, X2, X3, mergeA_in_gga(X1, .(zero, X2), X3))
MERGEA_IN_GGA(.(zero, X1), .(zero, X2), .(zero, X3)) → MERGEA_IN_GGA(X1, .(zero, X2), X3)
MERGEA_IN_GGA(.(X1, X2), .(X3, X4), .(X3, X5)) → U8_GGA(X1, X2, X3, X4, X5, gtC_in_gg(X1, X3))
MERGEA_IN_GGA(.(X1, X2), .(X3, X4), .(X3, X5)) → GTC_IN_GG(X1, X3)
GTC_IN_GG(s(X1), s(X2)) → U2_GG(X1, X2, gtC_in_gg(X1, X2))
GTC_IN_GG(s(X1), s(X2)) → GTC_IN_GG(X1, X2)
MERGEA_IN_GGA(.(X1, X2), .(X3, X4), .(X3, X5)) → U9_GGA(X1, X2, X3, X4, X5, gtcC_in_gg(X1, X3))
U9_GGA(X1, X2, X3, X4, X5, gtcC_out_gg(X1, X3)) → U10_GGA(X1, X2, X3, X4, X5, mergeA_in_gga(.(X1, X2), X4, X5))
U9_GGA(X1, X2, X3, X4, X5, gtcC_out_gg(X1, X3)) → MERGEA_IN_GGA(.(X1, X2), X4, X5)
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4), .(s(X3), X5)) → U11_GGA(X1, X2, X3, X4, X5, gtC_in_gg(X1, X3))
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4), .(s(X3), X5)) → GTC_IN_GG(X1, X3)
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4), .(s(X3), X5)) → U12_GGA(X1, X2, X3, X4, X5, gtcC_in_gg(X1, X3))
U12_GGA(X1, X2, X3, X4, X5, gtcC_out_gg(X1, X3)) → U13_GGA(X1, X2, X3, X4, X5, mergeA_in_gga(.(s(X1), X2), X4, X5))
U12_GGA(X1, X2, X3, X4, X5, gtcC_out_gg(X1, X3)) → MERGEA_IN_GGA(.(s(X1), X2), X4, X5)
MERGEA_IN_GGA(.(s(X1), X2), .(zero, X3), .(zero, X4)) → U14_GGA(X1, X2, X3, X4, mergeA_in_gga(.(s(X1), X2), X3, X4))
MERGEA_IN_GGA(.(s(X1), X2), .(zero, X3), .(zero, X4)) → MERGEA_IN_GGA(.(s(X1), X2), X3, X4)

The TRS R consists of the following rules:

lecB_in_gg(s(X1), s(X2)) → U25_gg(X1, X2, lecB_in_gg(X1, X2))
lecB_in_gg(zero, s(X1)) → lecB_out_gg(zero, s(X1))
lecB_in_gg(zero, zero) → lecB_out_gg(zero, zero)
U25_gg(X1, X2, lecB_out_gg(X1, X2)) → lecB_out_gg(s(X1), s(X2))
gtcC_in_gg(s(X1), s(X2)) → U26_gg(X1, X2, gtcC_in_gg(X1, X2))
gtcC_in_gg(s(X1), zero) → gtcC_out_gg(s(X1), zero)
U26_gg(X1, X2, gtcC_out_gg(X1, X2)) → gtcC_out_gg(s(X1), s(X2))

The argument filtering Pi contains the following mapping:
mergeA_in_gga(x1, x2, x3)  =  mergeA_in_gga(x1, x2)
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
leB_in_gg(x1, x2)  =  leB_in_gg(x1, x2)
lecB_in_gg(x1, x2)  =  lecB_in_gg(x1, x2)
U25_gg(x1, x2, x3)  =  U25_gg(x1, x2, x3)
zero  =  zero
lecB_out_gg(x1, x2)  =  lecB_out_gg(x1, x2)
gtC_in_gg(x1, x2)  =  gtC_in_gg(x1, x2)
gtcC_in_gg(x1, x2)  =  gtcC_in_gg(x1, x2)
U26_gg(x1, x2, x3)  =  U26_gg(x1, x2, x3)
gtcC_out_gg(x1, x2)  =  gtcC_out_gg(x1, x2)
MERGEA_IN_GGA(x1, x2, x3)  =  MERGEA_IN_GGA(x1, x2)
U3_GGA(x1, x2, x3, x4, x5, x6)  =  U3_GGA(x1, x2, x3, x4, x6)
LEB_IN_GG(x1, x2)  =  LEB_IN_GG(x1, x2)
U1_GG(x1, x2, x3)  =  U1_GG(x1, x2, x3)
U4_GGA(x1, x2, x3, x4, x5, x6)  =  U4_GGA(x1, x2, x3, x4, x6)
U5_GGA(x1, x2, x3, x4, x5, x6)  =  U5_GGA(x1, x2, x3, x4, x6)
U6_GGA(x1, x2, x3, x4, x5)  =  U6_GGA(x1, x2, x3, x5)
U7_GGA(x1, x2, x3, x4)  =  U7_GGA(x1, x2, x4)
U8_GGA(x1, x2, x3, x4, x5, x6)  =  U8_GGA(x1, x2, x3, x4, x6)
GTC_IN_GG(x1, x2)  =  GTC_IN_GG(x1, x2)
U2_GG(x1, x2, x3)  =  U2_GG(x1, x2, x3)
U9_GGA(x1, x2, x3, x4, x5, x6)  =  U9_GGA(x1, x2, x3, x4, x6)
U10_GGA(x1, x2, x3, x4, x5, x6)  =  U10_GGA(x1, x2, x3, x4, x6)
U11_GGA(x1, x2, x3, x4, x5, x6)  =  U11_GGA(x1, x2, x3, x4, x6)
U12_GGA(x1, x2, x3, x4, x5, x6)  =  U12_GGA(x1, x2, x3, x4, x6)
U13_GGA(x1, x2, x3, x4, x5, x6)  =  U13_GGA(x1, x2, x3, x4, x6)
U14_GGA(x1, x2, x3, x4, x5)  =  U14_GGA(x1, x2, x3, x5)

We have to consider all (P,R,Pi)-chains

(5) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 3 SCCs with 14 less nodes.

(6) Complex Obligation (AND)

(7) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

GTC_IN_GG(s(X1), s(X2)) → GTC_IN_GG(X1, X2)

The TRS R consists of the following rules:

lecB_in_gg(s(X1), s(X2)) → U25_gg(X1, X2, lecB_in_gg(X1, X2))
lecB_in_gg(zero, s(X1)) → lecB_out_gg(zero, s(X1))
lecB_in_gg(zero, zero) → lecB_out_gg(zero, zero)
U25_gg(X1, X2, lecB_out_gg(X1, X2)) → lecB_out_gg(s(X1), s(X2))
gtcC_in_gg(s(X1), s(X2)) → U26_gg(X1, X2, gtcC_in_gg(X1, X2))
gtcC_in_gg(s(X1), zero) → gtcC_out_gg(s(X1), zero)
U26_gg(X1, X2, gtcC_out_gg(X1, X2)) → gtcC_out_gg(s(X1), s(X2))

Pi is empty.
We have to consider all (P,R,Pi)-chains

(8) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(9) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

GTC_IN_GG(s(X1), s(X2)) → GTC_IN_GG(X1, X2)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains

(10) PiDPToQDPProof (EQUIVALENT transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(11) Obligation:

Q DP problem:
The TRS P consists of the following rules:

GTC_IN_GG(s(X1), s(X2)) → GTC_IN_GG(X1, X2)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(12) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • GTC_IN_GG(s(X1), s(X2)) → GTC_IN_GG(X1, X2)
    The graph contains the following edges 1 > 1, 2 > 2

(13) YES

(14) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

LEB_IN_GG(s(X1), s(X2)) → LEB_IN_GG(X1, X2)

The TRS R consists of the following rules:

lecB_in_gg(s(X1), s(X2)) → U25_gg(X1, X2, lecB_in_gg(X1, X2))
lecB_in_gg(zero, s(X1)) → lecB_out_gg(zero, s(X1))
lecB_in_gg(zero, zero) → lecB_out_gg(zero, zero)
U25_gg(X1, X2, lecB_out_gg(X1, X2)) → lecB_out_gg(s(X1), s(X2))
gtcC_in_gg(s(X1), s(X2)) → U26_gg(X1, X2, gtcC_in_gg(X1, X2))
gtcC_in_gg(s(X1), zero) → gtcC_out_gg(s(X1), zero)
U26_gg(X1, X2, gtcC_out_gg(X1, X2)) → gtcC_out_gg(s(X1), s(X2))

Pi is empty.
We have to consider all (P,R,Pi)-chains

(15) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(16) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

LEB_IN_GG(s(X1), s(X2)) → LEB_IN_GG(X1, X2)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains

(17) PiDPToQDPProof (EQUIVALENT transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(18) Obligation:

Q DP problem:
The TRS P consists of the following rules:

LEB_IN_GG(s(X1), s(X2)) → LEB_IN_GG(X1, X2)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(19) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • LEB_IN_GG(s(X1), s(X2)) → LEB_IN_GG(X1, X2)
    The graph contains the following edges 1 > 1, 2 > 2

(20) YES

(21) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4), .(s(X1), X5)) → U4_GGA(X1, X2, X3, X4, X5, lecB_in_gg(X1, X3))
U4_GGA(X1, X2, X3, X4, X5, lecB_out_gg(X1, X3)) → MERGEA_IN_GGA(X2, .(s(X3), X4), X5)
MERGEA_IN_GGA(.(zero, X1), .(s(X2), X3), .(zero, X4)) → MERGEA_IN_GGA(X1, .(s(X2), X3), X4)
MERGEA_IN_GGA(.(X1, X2), .(X3, X4), .(X3, X5)) → U9_GGA(X1, X2, X3, X4, X5, gtcC_in_gg(X1, X3))
U9_GGA(X1, X2, X3, X4, X5, gtcC_out_gg(X1, X3)) → MERGEA_IN_GGA(.(X1, X2), X4, X5)
MERGEA_IN_GGA(.(zero, X1), .(zero, X2), .(zero, X3)) → MERGEA_IN_GGA(X1, .(zero, X2), X3)
MERGEA_IN_GGA(.(s(X1), X2), .(zero, X3), .(zero, X4)) → MERGEA_IN_GGA(.(s(X1), X2), X3, X4)
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4), .(s(X3), X5)) → U12_GGA(X1, X2, X3, X4, X5, gtcC_in_gg(X1, X3))
U12_GGA(X1, X2, X3, X4, X5, gtcC_out_gg(X1, X3)) → MERGEA_IN_GGA(.(s(X1), X2), X4, X5)

The TRS R consists of the following rules:

lecB_in_gg(s(X1), s(X2)) → U25_gg(X1, X2, lecB_in_gg(X1, X2))
lecB_in_gg(zero, s(X1)) → lecB_out_gg(zero, s(X1))
lecB_in_gg(zero, zero) → lecB_out_gg(zero, zero)
U25_gg(X1, X2, lecB_out_gg(X1, X2)) → lecB_out_gg(s(X1), s(X2))
gtcC_in_gg(s(X1), s(X2)) → U26_gg(X1, X2, gtcC_in_gg(X1, X2))
gtcC_in_gg(s(X1), zero) → gtcC_out_gg(s(X1), zero)
U26_gg(X1, X2, gtcC_out_gg(X1, X2)) → gtcC_out_gg(s(X1), s(X2))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
lecB_in_gg(x1, x2)  =  lecB_in_gg(x1, x2)
U25_gg(x1, x2, x3)  =  U25_gg(x1, x2, x3)
zero  =  zero
lecB_out_gg(x1, x2)  =  lecB_out_gg(x1, x2)
gtcC_in_gg(x1, x2)  =  gtcC_in_gg(x1, x2)
U26_gg(x1, x2, x3)  =  U26_gg(x1, x2, x3)
gtcC_out_gg(x1, x2)  =  gtcC_out_gg(x1, x2)
MERGEA_IN_GGA(x1, x2, x3)  =  MERGEA_IN_GGA(x1, x2)
U4_GGA(x1, x2, x3, x4, x5, x6)  =  U4_GGA(x1, x2, x3, x4, x6)
U9_GGA(x1, x2, x3, x4, x5, x6)  =  U9_GGA(x1, x2, x3, x4, x6)
U12_GGA(x1, x2, x3, x4, x5, x6)  =  U12_GGA(x1, x2, x3, x4, x6)

We have to consider all (P,R,Pi)-chains

(22) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(23) Obligation:

Q DP problem:
The TRS P consists of the following rules:

MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4)) → U4_GGA(X1, X2, X3, X4, lecB_in_gg(X1, X3))
U4_GGA(X1, X2, X3, X4, lecB_out_gg(X1, X3)) → MERGEA_IN_GGA(X2, .(s(X3), X4))
MERGEA_IN_GGA(.(zero, X1), .(s(X2), X3)) → MERGEA_IN_GGA(X1, .(s(X2), X3))
MERGEA_IN_GGA(.(X1, X2), .(X3, X4)) → U9_GGA(X1, X2, X3, X4, gtcC_in_gg(X1, X3))
U9_GGA(X1, X2, X3, X4, gtcC_out_gg(X1, X3)) → MERGEA_IN_GGA(.(X1, X2), X4)
MERGEA_IN_GGA(.(zero, X1), .(zero, X2)) → MERGEA_IN_GGA(X1, .(zero, X2))
MERGEA_IN_GGA(.(s(X1), X2), .(zero, X3)) → MERGEA_IN_GGA(.(s(X1), X2), X3)
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4)) → U12_GGA(X1, X2, X3, X4, gtcC_in_gg(X1, X3))
U12_GGA(X1, X2, X3, X4, gtcC_out_gg(X1, X3)) → MERGEA_IN_GGA(.(s(X1), X2), X4)

The TRS R consists of the following rules:

lecB_in_gg(s(X1), s(X2)) → U25_gg(X1, X2, lecB_in_gg(X1, X2))
lecB_in_gg(zero, s(X1)) → lecB_out_gg(zero, s(X1))
lecB_in_gg(zero, zero) → lecB_out_gg(zero, zero)
U25_gg(X1, X2, lecB_out_gg(X1, X2)) → lecB_out_gg(s(X1), s(X2))
gtcC_in_gg(s(X1), s(X2)) → U26_gg(X1, X2, gtcC_in_gg(X1, X2))
gtcC_in_gg(s(X1), zero) → gtcC_out_gg(s(X1), zero)
U26_gg(X1, X2, gtcC_out_gg(X1, X2)) → gtcC_out_gg(s(X1), s(X2))

The set Q consists of the following terms:

lecB_in_gg(x0, x1)
U25_gg(x0, x1, x2)
gtcC_in_gg(x0, x1)
U26_gg(x0, x1, x2)

We have to consider all (P,Q,R)-chains.

(24) MRRProof (EQUIVALENT transformation)

By using the rule removal processor [LPAR04] with the following ordering, at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.
Strictly oriented dependency pairs:

MERGEA_IN_GGA(.(zero, X1), .(s(X2), X3)) → MERGEA_IN_GGA(X1, .(s(X2), X3))
MERGEA_IN_GGA(.(zero, X1), .(zero, X2)) → MERGEA_IN_GGA(X1, .(zero, X2))
MERGEA_IN_GGA(.(s(X1), X2), .(zero, X3)) → MERGEA_IN_GGA(.(s(X1), X2), X3)


Used ordering: Polynomial interpretation [POLO]:

POL(.(x1, x2)) = x1 + x2   
POL(MERGEA_IN_GGA(x1, x2)) = 2·x1 + 2·x2   
POL(U12_GGA(x1, x2, x3, x4, x5)) = 2·x1 + 2·x2 + 2·x3 + 2·x4 + 2·x5   
POL(U25_gg(x1, x2, x3)) = 2·x1 + 2·x2 + x3   
POL(U26_gg(x1, x2, x3)) = x1 + x2 + x3   
POL(U4_GGA(x1, x2, x3, x4, x5)) = x1 + 2·x2 + 2·x3 + 2·x4 + x5   
POL(U9_GGA(x1, x2, x3, x4, x5)) = x1 + 2·x2 + x3 + 2·x4 + x5   
POL(gtcC_in_gg(x1, x2)) = x1 + x2   
POL(gtcC_out_gg(x1, x2)) = x1 + x2   
POL(lecB_in_gg(x1, x2)) = 2·x1 + 2·x2   
POL(lecB_out_gg(x1, x2)) = 2·x1 + 2·x2   
POL(s(x1)) = 2·x1   
POL(zero) = 1   

(25) Obligation:

Q DP problem:
The TRS P consists of the following rules:

MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4)) → U4_GGA(X1, X2, X3, X4, lecB_in_gg(X1, X3))
U4_GGA(X1, X2, X3, X4, lecB_out_gg(X1, X3)) → MERGEA_IN_GGA(X2, .(s(X3), X4))
MERGEA_IN_GGA(.(X1, X2), .(X3, X4)) → U9_GGA(X1, X2, X3, X4, gtcC_in_gg(X1, X3))
U9_GGA(X1, X2, X3, X4, gtcC_out_gg(X1, X3)) → MERGEA_IN_GGA(.(X1, X2), X4)
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4)) → U12_GGA(X1, X2, X3, X4, gtcC_in_gg(X1, X3))
U12_GGA(X1, X2, X3, X4, gtcC_out_gg(X1, X3)) → MERGEA_IN_GGA(.(s(X1), X2), X4)

The TRS R consists of the following rules:

lecB_in_gg(s(X1), s(X2)) → U25_gg(X1, X2, lecB_in_gg(X1, X2))
lecB_in_gg(zero, s(X1)) → lecB_out_gg(zero, s(X1))
lecB_in_gg(zero, zero) → lecB_out_gg(zero, zero)
U25_gg(X1, X2, lecB_out_gg(X1, X2)) → lecB_out_gg(s(X1), s(X2))
gtcC_in_gg(s(X1), s(X2)) → U26_gg(X1, X2, gtcC_in_gg(X1, X2))
gtcC_in_gg(s(X1), zero) → gtcC_out_gg(s(X1), zero)
U26_gg(X1, X2, gtcC_out_gg(X1, X2)) → gtcC_out_gg(s(X1), s(X2))

The set Q consists of the following terms:

lecB_in_gg(x0, x1)
U25_gg(x0, x1, x2)
gtcC_in_gg(x0, x1)
U26_gg(x0, x1, x2)

We have to consider all (P,Q,R)-chains.

(26) MRRProof (EQUIVALENT transformation)

By using the rule removal processor [LPAR04] with the following ordering, at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.
Strictly oriented dependency pairs:

MERGEA_IN_GGA(.(X1, X2), .(X3, X4)) → U9_GGA(X1, X2, X3, X4, gtcC_in_gg(X1, X3))
U12_GGA(X1, X2, X3, X4, gtcC_out_gg(X1, X3)) → MERGEA_IN_GGA(.(s(X1), X2), X4)

Strictly oriented rules of the TRS R:

lecB_in_gg(zero, s(X1)) → lecB_out_gg(zero, s(X1))
lecB_in_gg(zero, zero) → lecB_out_gg(zero, zero)

Used ordering: Polynomial interpretation [POLO]:

POL(.(x1, x2)) = 1 + 2·x1 + 2·x2   
POL(MERGEA_IN_GGA(x1, x2)) = x1 + x2   
POL(U12_GGA(x1, x2, x3, x4, x5)) = 2 + 2·x1 + 2·x2 + x3 + x4 + 2·x5   
POL(U25_gg(x1, x2, x3)) = 2·x1 + 2·x2 + x3   
POL(U26_gg(x1, x2, x3)) = x1 + x2 + x3   
POL(U4_GGA(x1, x2, x3, x4, x5)) = 1 + 2·x1 + x2 + 2·x3 + 2·x4 + x5   
POL(U9_GGA(x1, x2, x3, x4, x5)) = 1 + x1 + 2·x2 + x3 + x4 + x5   
POL(gtcC_in_gg(x1, x2)) = x1 + x2   
POL(gtcC_out_gg(x1, x2)) = x1 + x2   
POL(lecB_in_gg(x1, x2)) = 1 + 2·x1 + 2·x2   
POL(lecB_out_gg(x1, x2)) = x1 + 2·x2   
POL(s(x1)) = 2·x1   
POL(zero) = 0   

(27) Obligation:

Q DP problem:
The TRS P consists of the following rules:

MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4)) → U4_GGA(X1, X2, X3, X4, lecB_in_gg(X1, X3))
U4_GGA(X1, X2, X3, X4, lecB_out_gg(X1, X3)) → MERGEA_IN_GGA(X2, .(s(X3), X4))
U9_GGA(X1, X2, X3, X4, gtcC_out_gg(X1, X3)) → MERGEA_IN_GGA(.(X1, X2), X4)
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4)) → U12_GGA(X1, X2, X3, X4, gtcC_in_gg(X1, X3))

The TRS R consists of the following rules:

lecB_in_gg(s(X1), s(X2)) → U25_gg(X1, X2, lecB_in_gg(X1, X2))
U25_gg(X1, X2, lecB_out_gg(X1, X2)) → lecB_out_gg(s(X1), s(X2))
gtcC_in_gg(s(X1), s(X2)) → U26_gg(X1, X2, gtcC_in_gg(X1, X2))
gtcC_in_gg(s(X1), zero) → gtcC_out_gg(s(X1), zero)
U26_gg(X1, X2, gtcC_out_gg(X1, X2)) → gtcC_out_gg(s(X1), s(X2))

The set Q consists of the following terms:

lecB_in_gg(x0, x1)
U25_gg(x0, x1, x2)
gtcC_in_gg(x0, x1)
U26_gg(x0, x1, x2)

We have to consider all (P,Q,R)-chains.

(28) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 1 SCC with 2 less nodes.

(29) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U4_GGA(X1, X2, X3, X4, lecB_out_gg(X1, X3)) → MERGEA_IN_GGA(X2, .(s(X3), X4))
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4)) → U4_GGA(X1, X2, X3, X4, lecB_in_gg(X1, X3))

The TRS R consists of the following rules:

lecB_in_gg(s(X1), s(X2)) → U25_gg(X1, X2, lecB_in_gg(X1, X2))
U25_gg(X1, X2, lecB_out_gg(X1, X2)) → lecB_out_gg(s(X1), s(X2))
gtcC_in_gg(s(X1), s(X2)) → U26_gg(X1, X2, gtcC_in_gg(X1, X2))
gtcC_in_gg(s(X1), zero) → gtcC_out_gg(s(X1), zero)
U26_gg(X1, X2, gtcC_out_gg(X1, X2)) → gtcC_out_gg(s(X1), s(X2))

The set Q consists of the following terms:

lecB_in_gg(x0, x1)
U25_gg(x0, x1, x2)
gtcC_in_gg(x0, x1)
U26_gg(x0, x1, x2)

We have to consider all (P,Q,R)-chains.

(30) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(31) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U4_GGA(X1, X2, X3, X4, lecB_out_gg(X1, X3)) → MERGEA_IN_GGA(X2, .(s(X3), X4))
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4)) → U4_GGA(X1, X2, X3, X4, lecB_in_gg(X1, X3))

The TRS R consists of the following rules:

lecB_in_gg(s(X1), s(X2)) → U25_gg(X1, X2, lecB_in_gg(X1, X2))
U25_gg(X1, X2, lecB_out_gg(X1, X2)) → lecB_out_gg(s(X1), s(X2))

The set Q consists of the following terms:

lecB_in_gg(x0, x1)
U25_gg(x0, x1, x2)
gtcC_in_gg(x0, x1)
U26_gg(x0, x1, x2)

We have to consider all (P,Q,R)-chains.

(32) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

gtcC_in_gg(x0, x1)
U26_gg(x0, x1, x2)

(33) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U4_GGA(X1, X2, X3, X4, lecB_out_gg(X1, X3)) → MERGEA_IN_GGA(X2, .(s(X3), X4))
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4)) → U4_GGA(X1, X2, X3, X4, lecB_in_gg(X1, X3))

The TRS R consists of the following rules:

lecB_in_gg(s(X1), s(X2)) → U25_gg(X1, X2, lecB_in_gg(X1, X2))
U25_gg(X1, X2, lecB_out_gg(X1, X2)) → lecB_out_gg(s(X1), s(X2))

The set Q consists of the following terms:

lecB_in_gg(x0, x1)
U25_gg(x0, x1, x2)

We have to consider all (P,Q,R)-chains.

(34) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4)) → U4_GGA(X1, X2, X3, X4, lecB_in_gg(X1, X3))
    The graph contains the following edges 1 > 1, 1 > 2, 2 > 3, 2 > 4

  • U4_GGA(X1, X2, X3, X4, lecB_out_gg(X1, X3)) → MERGEA_IN_GGA(X2, .(s(X3), X4))
    The graph contains the following edges 2 >= 1

(35) YES